package com.lqfan.autoAnswerQ.dao.quesBank;

import com.lqfan.autoAnswerQ.model.quesBank.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lqfan
 * @since 2020-04-05
 */
@Mapper
public interface QuestionMapper extends BaseMapper<Question> {
    /**
     * 增加做题次数
     * @param userId
     * @param id
     * @return
     */
    @Update("update question set doNumber=doNumber+1 where userId=#{userId} and id=#{id}")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    boolean updateDoNum(String userId,String id);
}
